//求二叉树最大半径
public class TreeMaxdiameter {
}
class TreeMaxdiameterSolution {
    int ret = 0;
    public int diameterOfBinaryTree(TreeNode root) {
        getHeight(root);
        return ret-1;
    }
    int getHeight(TreeNode root){
        if(root==null)return 0;
        int left = getHeight(root.left);
        int right = getHeight(root.right);
        ret = Math.max(ret,left+right+1);
        return Math.max(left,right)+1;
    }
}